<template>
    <div class="tabbar">
        <van-tabbar v-model="currentIndex">
            <template v-for="(item, index) in tarbarData" >
                <van-tabbar-item  :to="item.path">
                    <span>{{ item.text }}</span>
                    <template #icon>        
                        <img v-if="currentIndex!==index" :src="getAssetsFile(item.image)" alt="">    
                        <img  v-else="currentIndex==index" :src="getAssetsFile(item.imageActive)" alt="">    
                    </template>
                </van-tabbar-item>
            </template>
        </van-tabbar>
    </div>
</template>

<script setup>
    import tarbarData from '@/assets/data/tarbar';
    import getAssetsFile from '@/utils/getFile';
    import {ref} from 'vue';
    const currentIndex=ref(0)

   
</script>

<style  lang="less" scoped>
.tabbar {
    :deep(.van-tabbar-item){
            font-size: 15px;
    }
    img{
        height: 28px;
    }
}   
</style>